package top.abrsm.util;

import com.github.wxpay.sdk.WXPayConfig;

import java.io.InputStream;

/**
 * @Author: Wuzh
 * @Description: 常量工具类, 替换魔法值
 * 实现WXPayConfig接口是为了在微信扫码支付的时候拿到商户号以及APPID
 * @Date Created in 22:18 2020/9/20
 * @return
 */
public class ConstUtil implements WXPayConfig {


    /**
     * 阿里云配置参数
     * 1、endpoint：oss中的endpoint节点
     * 2、accessKeyId：oss的keyId
     * 3、accessKeySecret：oss的秘钥
     * 4、url：外网访问oss的基url，访问时后面带上Bucket的名称和文件夹以及文件名称
     */
    public final static String bucketName = "abrsm";
    public final static String endpoint = "https://oss-cn-shanghai.aliyuncs.com";
    public final static String accessKeyId = "LTAI5tGCkryg2GHzWSUYQRus"; // accessKeyId
    public final static String accessKeySecret = "EAu3u8MPNIoNzZxOskZPosOjAd4dSY"; // accessKeySecret
    public final static String url = "https://abrsm.oss-cn-shanghai.aliyuncs.com/";


    /**
     * 微信扫码登录
     * 常用数据
     * QQ扫码登录
     * 微信公众号
     * 常用数据
     */
    public final static String WX_OAUTH_URL = "https://open.weixin.qq.com/connect/qrconnect?appid=APPID&redirect_uri=REDIRECTURL&response_type=code&scope=SCOPE&state=STATE&style=white#wechat_redirect";
    public final static String WX_App_ID = "wx99d0d0f0175eedb1"; //ABRSM 考级圈appid
    //public final static String WX_AppID = "wxd5a6e359501c6997"; //ABRSM wxd5a6e359501c6997 扫码登录的公众号appid
    //public final static String WX_REDIRECT_URL = "http://www.abrsmtheory.top/student/checkWxLogin";
    //public final static String WX_SCOPE = "snsapi_login"; //表示获取用户微信信息
    //public final static String WX_App_Secret = "269cd9578be636d87f5d97c612911ccc"; //ABRSM 考级圈 secret
    //public final static String WX_AppSecret = "c248a750518013e647efe7ba18b2c2f8"; //ABRSM

    /**
     * 伯小牙公众号消息推送
     */
    public final static String PUBLIC_AppID = "wx3bf7d5d0d782232e"; //伯小牙Music成长营
    public final static String PUBLIC_AppSecret = "77431774ca4826acffc8e9aba8693b6f";


    //TOP乐理教育在线支付信息
    //小程序支付相关参数
    public final static String PAY_AppID = "wx99d0d0f0175eedb1"; // 请求ID和支付ID都是微信小程序的APP_ID
    public final static String MCH_ID = "1509022311";
    public final static String KEY = "Mt111111111111111111111111111111";
    public final static String BASH_PATH = "https://api.mch.weixin.qq.com/pay/unifiedorder";//统一下单请求地址,微信官方提供
    public final static String NOTIFY_URL = "https://store.abrsmtheory.top/pay/payNotice/orders/notice";//扫码支付回调地址,必须是外网能够访问的
    // 退款请求链接
    public final static String REFUND_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";


    /**
     * 订单状态
     */
    public final static Integer ORDER_STATUS_NO_PAY = 0; // 未付款
    public final static Integer ORDER_STATUS = 1;   //
    public final static Integer ORDER_STATUS_PAY_ING = 2; // 已付款
    public final static Integer ORDER_STATUS_END = 3; // 已收到货物，交易自动关闭
    public final static Integer ORDER_STATUS_SEND = 4; // 已发货待收货
    public final static Integer ORDER_STATUS_REFUND = 5; // 退款


    /**
     * 文件类型：
     * 1  轮播图
     * 2  商品表
     * 3 用户表
     * 4 论坛帖子图片
     * 5 论坛帖子视频
     */
    public final static int FILE_BANNER = 1;
    public final static int FILE_PRODUCT = 2;
    public final static int FILE_USER = 3;
    public final static int FILE_POSTS_IMG = 4;
    public final static int FILE_POSTS_VIDEO = 5;

    /**
     * 时间格式化DATE_FOMRMAT
     */
    public final static String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public final static String DATE_FORMAT = "yyyy-MM-dd";


    /**
     * 学生注册方式
     * 咨询录入：PC
     * 社区注册：图芽社区
     * 小程序注册：小程序
     */

    public String getAppID () {
        return WX_App_ID;
    }


    public String getMchID () {
        return MCH_ID;
    }

    public String getKey () {
        return KEY;
    }

    public InputStream getCertStream () {
        return null;
    }

    public int getHttpConnectTimeoutMs () {
        return 5000;
    }

    public int getHttpReadTimeoutMs () {
        return 5000;
    }

}

